<div class="content">
	<form method="post" action="">
	<div class="lookup">
		<label>Nhập dãy số cần tra</label>
		<input name="number" type="text" value="<?php echo(isset($input_form['number']) ? $input_form['number'] : '');?>" />
		<label>Chọn tỉnh</label>
		<select name="lid">
			<?php foreach($locations as $k => $v):?>
			<option <?php echo(isset($input_form['lid']) && $input_form['lid'] == $v->id ? 'selected="selected"' : '');?> value="<?php echo $v->id;?>"><?php echo $v->name;?></option>
			<?php endforeach;?>
		</select>
		<label>Chọn ngày</label>
		<div class="box-select">
			<select name="day" class="date">
				<option>Ngày</option>
				<?php for($d=1; $d<=31; $d++):?>
				<option <?php echo(isset($input_form['day']) && $input_form['day'] == $d ? 'selected="selected"' : '');?> value="<?php echo $d;?>"><?php echo $d;?></option>
				<?php endfor;?>
			</select>
			<select name="month" class="month">
				<option>Tháng</option>
				<?php for($m=1; $m <= 12; $m++):?>
				<option <?php echo(isset($input_form['month']) && $input_form['month'] == $m ? 'selected="selected"' : '');?> value="<?php echo $m;?>"><?php echo $m;?></option>
				<?php endfor;?>
			</select>
			<select name="year" class="year">
				<option>Năm</option>
				<?php $cur_y = date('Y');?>
				<?php for($y = ($cur_y - 5); $y <= $cur_y; $y++):?>
				<option <?php echo(isset($input_form['year']) && $input_form['year'] == $y ? 'selected="selected"' : '');?> value="<?php echo $y;?>"><?php echo $y;?></option>
				<?php endfor;?>
			</select>
		</div>
		<button type="submit" class="box-css3"><span>Xem</span></button>
	</div>	
	</form>
	
	
	<?php 
	if(isset($result->lo)):
	?>
	<div class="lookup-num">
		<p>Thống kê số<span class="txt-num"><?php echo(isset($input_form['number']) ? $input_form['number'] : '');?></span></p>
		<p>Xuất hiện trong ngày <span class="red"><?php echo(isset($input_form['day']) && isset($input_form['month']) && isset($input_form['year']) ? $input_form['day'].'/'.$input_form['month'].'/'.$input_form['year'] : '');?></span></p>
		<table class="tbl-list">
			<tr>
				<th class="t-cen">Giải</th>
				<th class="t-cen">Lần</th>
			</tr>
			<?php $i=0;?>
			<?php foreach($result->lo as $k => $v):?>
			<?php if($v > 0):?>
			<tr>
				<td class="t-cen"><?php echo ($k == 0 ? 'ĐB' : $k);?></td>
				<td class="t-cen"><?php echo $v;?></td>
			</tr>
			<?php $i++;?>
			<?php endif;?>
			<?php endforeach;?>
			<?php if($i==0):?>
			<tr>
				<td colspan="2">Số <?php echo(isset($input_form['number']) ? $input_form['number'] : '');?> không xuất hiện</td>
			</tr>
			<?php endif;?>
		</table>
	</div>
	<?php endif;?>
	<div class="bot-mobile clearfix">
		<div class="share">Chia sẻ cầu lên</div>
		<?php $this->load->view('client/layout/shared');?>
	</div>
</div>